<template>
  <div class="box">
    <div class="title">
      我的
    </div>
    <!-- 头像信息 -->
    <div class="head_img">
      <img :src="info.head" alt="头像">
      <div>
        <div>{{ info.nickname }}</div>
        <div @click="$router.push({path:'/listmyInfo'})">
          <span>修改个人信息</span><span class="el-icon-arrow-right"></span>
        </div>
      </div>
    </div>
    <!--  -->
    <div class="my_card">
      <div @click="$router.push({path:'/listConsumption'})">
        <div>
          <img src="../../../../assets/static/My/q1.png">
          <span>我的消费记录</span>
        </div>
        <div class="el-icon-arrow-right"></div>
      </div>
      <div @click="$router.push({path:'/listmyInfo'})">
        <div>
          <img src="../../../../assets/static/My/q2.png">
          <span>我的信息</span>
        </div>
        <div class="el-icon-arrow-right"></div>
      </div>
      <div>
        <div>
          <img src="../../../../assets/static/My/q3.png">
          <span>注销</span>
        </div>
        <div class="el-icon-arrow-right"></div>
      </div>
    </div>
  </div>
</template>

<script>
import {myInfo} from '@/api/merbership/my'

export default {
  data() {
    return {
      info: {}
    }
  },
  mounted() {
    this.myInfo()
  },
  methods: {
    /**
     * 我的信息
     */
    myInfo() {
      const pd = {}
      myInfo(pd)
        .then(res => {
          this.info = res.data.data
        })
    }
  }
}
</script>

<style scoped>
.box {
  height: 100vh;
  background-color: #F5F5F5;
}

/* 标题 */
.title {
  background-color: #7ac91b;
  color: #fff;
  font-size: 18px;
  text-align: center;
  padding: 15px;
  font-weight: bold;
}

.head_img {
  margin: 15px;
  display: flex;
  align-items: center;
}

.head_img img {
  width: 90px;
}

.head_img > div > div:nth-child(1) {
  font-size: 18px;
  font-weight: bold;
  margin-right: 5px;
}

.head_img > div > div:nth-child(2) {
  font-size: 13px;
  color: #999999;
  margin-top: 15px;
}

.head_img .el-icon-arrow-right {
  margin-left: 10px;
}

/*  */
.my_card {
  margin: 15px;
}

.my_card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  box-shadow: 0 3px 5px #ccc;
  padding: 5px;
  border-radius: 10px;
  margin: 10px 0;
}

.my_card img {
  width: 40px;
  margin-top: 5px;
}

.my_card > div > div:nth-child(1) {
  display: flex;
  align-items: center;
}

</style>
